Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make TouchableNativeFeedback strict mode compatible #48522

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

mateoguzmana
Copy link
Contributor

@mateoguzmana mateoguzmana commented Jan 7, 2025

Summary:

Related to #22186

There are still some components that are not strict mode compatible. I found this one when wrapping the RNTester in StrictMode and opening the DrawerLayoutAndroid example.

The Button component uses TouchableNativeFeedback for Android which is currently using findHostInstance_DEPRECATED to manage the ref. In this PR we simply swipe the way of attaching the reference by using createRef.

StrictMode error for TouchableNativeFeedback image

Changelog:

[GENERAL] [FIXED] - Make TouchableNativeFeedback strict mode compatible

Test Plan:

  • Checked there are no more StrictMode warnings.
  • Manually checked that the ref used in the functions inside the component returns the same value as getting the ref with findHostInstance_DEPRECATED(this) and verified it still triggers the related Commands calls.

@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team. labels Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. Shared with Meta Applied via automation to indicate that an Issue or Pull Request has been shared with the team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants